const xlsx = require("node-xlsx");
const path = require("path");
const uuid = require("uuid");

const job = require("../Job")

// 导入职位
const jobData = xlsx.parse(path.join( __dirname, "..", "..", "xlsx", "job.xlsx" ))[0].data;
const arr = [];
for(let i=1; i<jobData.length; i++){
  arr.push({
    jId: 'job-'+uuid.v1(),
    jName: jobData[i][0]
  })
}
job.insertMany( arr ).then(()=>{
  console.log('职位导入成功');
})